/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						script_material_quantity.h

	$Header: /heroes4/script_material_quantity.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_MATERIAL_QUANTITY_H_INCLUDED )
#define SCRIPT_MATERIAL_QUANTITY_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "script_expression_type.h"
#include "script_target_type.h"
#include "script_targeted_expression.h"

enum t_material;

// --------------------------------------------------------------------------
// t_script_material_quantity class
// --------------------------------------------------------------------------

class t_script_material_quantity
	:	public t_script_targeted_numeric_expression< t_script_player_target >
{
public:
	// Constructor
	t_script_material_quantity();

	// Member functions
	virtual t_result	evaluate(t_expression_context_hero const& context) const;
	virtual t_result	evaluate(t_expression_context_town const& context) const;
	virtual t_result	evaluate(t_expression_context_object const& context) const;
	virtual t_result	evaluate(t_expression_context_army const& context) const;
	virtual t_result	evaluate(t_expression_context_global const& context) const;

	t_material			get_material() const;
	virtual bool		read( std::streambuf& stream, int version);
	virtual bool		read_from_map(
							std::streambuf &	stream,
							int					format_version );
	virtual bool		write( std::streambuf& stream ) const;

private:
	// Data members
	t_material	m_material;
};

// --------------------------------------------------------------------------
// t_script_material_quantity inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_script_material_quantity::t_script_material_quantity()
	:	m_material( t_material( 0 ) )
{
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_material t_script_material_quantity::get_material() const
{
	return m_material;
}

SPECIALIZE_SCRIPT_NUMERIC_EXPRESSION( k_script_numeric_material_quantity, t_script_material_quantity );

#endif // !defined( SCRIPT_CREATURES_IN_ARMY_H_INCLUDED )
